package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RegularMsgSendMapper;
import com.ruoyi.system.domain.RegularMsgSend;
import com.ruoyi.system.service.IRegularMsgSendService;

/**
 * 定时发送消息记录Service业务层处理
 * 
 * @author DEREK
 * @date 2024-03-02
 */
@Service
public class RegularMsgSendServiceImpl extends ServiceImpl<RegularMsgSendMapper, RegularMsgSend> implements IRegularMsgSendService 
{
    @Autowired
    private RegularMsgSendMapper regularMsgSendMapper;

    /**
     * 查询定时发送消息记录
     * 
     * @param id 定时发送消息记录主键
     * @return 定时发送消息记录
     */
    @Override
    public RegularMsgSend selectRegularMsgSendById(Long id)
    {
        return regularMsgSendMapper.selectRegularMsgSendById(id);
    }

    /**
     * 查询定时发送消息记录列表
     * 
     * @param regularMsgSend 定时发送消息记录
     * @return 定时发送消息记录
     */
    @Override
    public List<RegularMsgSend> selectRegularMsgSendList(RegularMsgSend regularMsgSend)
    {
        return regularMsgSendMapper.selectRegularMsgSendList(regularMsgSend);
    }

    /**
     * 新增定时发送消息记录
     * 
     * @param regularMsgSend 定时发送消息记录
     * @return 结果
     */
    @Override
    public int insertRegularMsgSend(RegularMsgSend regularMsgSend)
    {
        regularMsgSend.setCreateTime(DateUtils.getNowDate());
        return regularMsgSendMapper.insertRegularMsgSend(regularMsgSend);
    }

    /**
     * 修改定时发送消息记录
     * 
     * @param regularMsgSend 定时发送消息记录
     * @return 结果
     */
    @Override
    public int updateRegularMsgSend(RegularMsgSend regularMsgSend)
    {
        regularMsgSend.setUpdateTime(DateUtils.getNowDate());
        return regularMsgSendMapper.updateRegularMsgSend(regularMsgSend);
    }

    /**
     * 批量删除定时发送消息记录
     * 
     * @param ids 需要删除的定时发送消息记录主键
     * @return 结果
     */
    @Override
    public int deleteRegularMsgSendByIds(Long[] ids)
    {
        return regularMsgSendMapper.deleteRegularMsgSendByIds(ids);
    }

    /**
     * 删除定时发送消息记录信息
     * 
     * @param id 定时发送消息记录主键
     * @return 结果
     */
    @Override
    public int deleteRegularMsgSendById(Long id)
    {
        return regularMsgSendMapper.deleteRegularMsgSendById(id);
    }
}
